smartbuck8 2.2.0
Loading...
Searching...
No Matches
smartbuck8


Smart Buck 8 Click

Smart Buck 8 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : May 2025.
  • Type : I2C type

Software Support

Example Description

This example demonstrates the use of the Smart Buck 8 Click board. The application cyclically adjusts the output voltage between its minimum and maximum values in steps and monitors the PG (Power Good) pin for any fault conditions. It logs any detected faults including undervoltage lockout, thermal warning, or hiccup event status.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.SmartBuck8

Example Key Functions

  • smartbuck8_cfg_setup This function initializes Click configuration structure to initial values.
    void smartbuck8_cfg_setup(smartbuck8_cfg_t *cfg)
    Smart Buck 8 configuration object setup function.
    Smart Buck 8 Click configuration object.
    Definition smartbuck8.h:180
  • smartbuck8_init This function initializes all necessary pins and peripherals used for this Click board.
    err_t smartbuck8_init(smartbuck8_t *ctx, smartbuck8_cfg_t *cfg)
    Smart Buck 8 initialization function.
    Smart Buck 8 Click context object.
    Definition smartbuck8.h:159
  • smartbuck8_default_cfg This function executes a default configuration of Smart Buck 8 Click board.
    err_t smartbuck8_default_cfg(smartbuck8_t *ctx)
    Smart Buck 8 default configuration function.
  • smartbuck8_get_pg_pin This function reads the logic level of the PG (power-good) pin.
    uint8_t smartbuck8_get_pg_pin(smartbuck8_t *ctx)
    Smart Buck 8 get power-good pin function.
  • smartbuck8_read_status This function reads the value of the STATUS register and returns it via output pointer.
    err_t smartbuck8_read_status ( smartbuck8_t *ctx, uint8_t *status );
    err_t smartbuck8_read_status(smartbuck8_t *ctx, uint8_t *status)
    Smart Buck 8 read status register function.
  • smartbuck8_set_vout This function sets the output voltage by writing a scaled value to the VOUT register.
    err_t smartbuck8_set_vout ( smartbuck8_t *ctx, uint16_t vout_mv );
    err_t smartbuck8_set_vout(smartbuck8_t *ctx, uint16_t vout_mv)
    Smart Buck 8 set output voltage function.

Application Init

Initializes the logger and the Smart Buck 8 Click driver, and applies the default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
smartbuck8_cfg_t smartbuck8_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
smartbuck8_cfg_setup( &smartbuck8_cfg );
SMARTBUCK8_MAP_MIKROBUS( smartbuck8_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == smartbuck8_init( &smartbuck8, &smartbuck8_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( SMARTBUCK8_ERROR == smartbuck8_default_cfg ( &smartbuck8 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define SMARTBUCK8_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition smartbuck8.h:144
void application_init(void)
Definition main.c:31
@ SMARTBUCK8_ERROR
Definition smartbuck8.h:200

Application Task

Cycles the output voltage up and down between the minimum and maximum supported values. Checks for fault conditions via the PG pin and logs detailed status flags if any fault is detected.

void application_task ( void )
{
static uint16_t vout = SMARTBUCK8_VOUT_MV_MIN;
static int16_t vout_step = 50;
static uint8_t status = 0;
if ( !smartbuck8_get_pg_pin ( &smartbuck8 ) )
{
log_printf( &logger, "\r\n Fault indication detected via PG pin!\r\n" );
if ( SMARTBUCK8_OK == smartbuck8_read_status ( &smartbuck8, &status ) )
{
{
log_printf ( &logger, " Junction temperature is higher than 130C\r\n" );
}
if ( status & SMARTBUCK8_STATUS_HICCUP )
{
log_printf ( &logger, " Device has HICCUP status once\r\n" );
}
if ( status & SMARTBUCK8_STATUS_UVLO )
{
log_printf ( &logger, " The input voltage is less than UVLO threshold (falling edge)\r\n" );
}
}
}
if ( SMARTBUCK8_OK == smartbuck8_set_vout ( &smartbuck8, vout ) )
{
log_printf ( &logger, "\r\n VOUT: %u mV\r\n", vout );
vout += vout_step;
if ( ( vout > SMARTBUCK8_VOUT_MV_MAX ) || ( vout < SMARTBUCK8_VOUT_MV_MIN ) )
{
vout_step = -vout_step;
vout += vout_step;
vout += vout_step;
}
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
#define SMARTBUCK8_STATUS_HICCUP
Definition smartbuck8.h:110
#define SMARTBUCK8_VOUT_MV_MIN
Smart Buck 8 vout setting.
Definition smartbuck8.h:117
#define SMARTBUCK8_STATUS_UVLO
Definition smartbuck8.h:111
#define SMARTBUCK8_VOUT_MV_MAX
Definition smartbuck8.h:118
#define SMARTBUCK8_STATUS_THERMAL_WARNING
Smart Buck 8 STATUS register setting.
Definition smartbuck8.h:109
void application_task(void)
Definition main.c:67
@ SMARTBUCK8_OK
Definition smartbuck8.h:199

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.